InitGui
InitGui() initializes message number variables for every message GraphicsDesigner and
GuiDesigner recognize. If you create new messages of your own, add them to InitProgram() .
Don't forget to make your new message variables shared, as in #MyMessage.
InitProgram() and InitWindows()
InitProgram() and InitWindows() are empty functions waiting for code your program needs to
initialize itself and / or its windows. If your program doesn't need initialization, leave
InitProgram() and / or InitWindows() empty, but don't delete them.
CreateWindows()
CreateWindows() is the function that creates and displays the windows for your program
with the following lines:
Design (@Design, #CreateWindow, x, y, width, height, 0, "")
XuiSendMessage ( Design, #SetCallback, Design, &DesignCode(), -1, -1, 0, 0)
XuiSendMessage ( Design, #DisplayWindow, 0, 0, 0, 0, 0, 0)
As you design more windows for your program, GuiDesigner adds similar sets of lines. This
creates every window in your program, even if most won't be displayed until later. Comment
out the DisplayWindow line for windows that shouldn't appear at startup.
Design()
When you're ready, GuiDesigner will convert a design window into:
░ Code in CreateWindows() to create, initialize, and display the window.
░ A grid function that knows how to create and operate the window.
░ A callback function to handle callback messages from the grid function.
The name of the grid function is the name you gave to the design window. The callback
function is the same with Code appended. For example:
Design - Name you gave to your design window.
Design - Name of the grid type created from your design window.
Design() - Name of the grid function that creates and operates the design window.
DesignCode() - Name of the callback function that handles callbacks from the grid
function.
DesignCode
DesignCode() is the callback function or "code function" that callback messages
are sent to when important events occur in your window. This connection was established
when CreateWindows() sent a SetCallback message to the Design grid.
DesignCode() is the function in your program that responds to events in the Design window.
When the user clicks on a PushButton or selects an item from a Menu or List, DesignCode()
hears about it, because Design() sends it a callback message.
The code in DesignCode() examines the callback message and arguments to determine the
nature of the callback message, and takes appropriate action. Though GuiDesigner creates
callback functions complete with code to receive callback messages, you have to add the
code that responds to user actions.